﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace SHRP.UI.Controls
{
    public partial class BaseDataGridView : DataGridView
    {
        public BaseDataGridView():
        {
            InitializeComponent();
        }

        public BaseDataGridView(IContainer container):
        {
            container.Add(this);

            InitializeComponent();
        }
        protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
        {
            base.ProcessCmdKey(ref msg, keyData);
            int WM_KEYDOWN = 256;
            int WM_SYSKEYDOWN = 260;
            bool _disable = false;
            if (msg.Msg == WM_KEYDOWN || msg.Msg == WM_SYSKEYDOWN)
            {
                switch (keyData)
                {
                    case Keys.Enter:
                        SendKeys.Send("{Tab}");
                        _disable = true;
                        break;
                }
            }
            return _disable;
        }
    }
}
